<?php
/**
 * Scheduler module for Joomla! 1.5
 * @author      DHTMLX, <dhtmlx.gmail.com>
 * @package		scheduler
 * @subpackage	scheduler
 * @version     1.0.0
 * @copyright   Copyright (C) 2009 DHTML LTD , http://dhtmlx.com
 * @license     http://www.gnu.org/licenses/gpl.html GNU/GPL
 */

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

// Require the base controller
$scheduler_debug = true;
$scheduler_log = '';
require_once( JPATH_COMPONENT.DS.'controller.php' );

// Require specific controller if requested
if ($controller = JRequest::getWord('controller')) {
	$path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
	if (file_exists($path)) {
		require_once $path;
	} else {
		$controller = '';
	}
}

// Create the controller
$classname	= 'SchedulerController'.$controller;
$controller	= new $classname();

// Perform the Request task
$controller->execute( JRequest::getVar( 'task' ) );


// Redirect if set by the controller
$controller->redirect();